<template>
  <div id="newlist">
    <ul class="mui-table-view">
      <li class="mui-table-view-cell mui-media" v-for="(arr,index) in arrnew" :key="index">
        <router-link :to="'/home/Newinfo/'+arr.id">
          <img class="mui-media-object mui-pull-left" src="../assets/images/menu1.png">
          <div class="mui-media-body">
            <h1>{{arr.title}}</h1>
            <p class="mui-ellipsis">
              <span>发表时间：{{arr.add_time | myFilter}}</span>
              <span>点击:{{arr.click}}次</span>
            </p>
          </div>
        </router-link>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arrnew: []
    };
  },
  methods: {
    getnewlist() {
      this.$axios.get("/api/getnewslist").then(res => {
        this.arrnew = res.data.message;
        console.log(this.arrnew);
      });
    }
  },
  created() {
    this.getnewlist();
  }
};
</script>

<style scoped lang="scss">
.mui-table-view {
  li {
    h1 {
      font-size: 14px;
    }
    .mui-ellipsis {
      color: blue;
      display: flex;
      justify-content: space-between;
    }
  }
}
</style>
